<div id="content_header">
  <h3>Refunds</h3>
</div>

<!-- <div class="row">
    <div class="col-xs-6">
      <label for="keyword">SEARCH</label>
      <div class="row">
        <div class="col-md-12">
          <form class="form-vertical" ng-submit="searchStudent()">
            <div class="input-group">
              <input class="form-control" type="text" name="keyword" id="keyword" placeholder="Type Name or Student ID and press enter to search" ng-model="searchText">
              <span class="input-group-btn">
                <button class="btn btn-default" type="button">Go!</button>
                </span>
            </div>
          </form>
        </div>
      </div>
    </div>
    <div class="col-xs-6">
      <label>RESULTS</label>
      <div class="row">
        <div class="search-message">
          Found <span class="primary-color"><b>{{ (students | filter:searchKey).length }}</b></span> matched records
        </div>
      </div>
    </div>
</div> -->
<div class="row">
  <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
    <table class="table table-hover">
      <thead>
        <tr>
          <th>#</th>
          <th>Student</th>
          <th>SID</th>
          <th>Refund Type</th>
          <th>Enrollment</th>
          <th>Enrollment Target</th>
          <th>Request Date</th>
          <th>Refund Status</th>
        </tr>
      </thead>
      <tbody>
        <tr dir-paginate="refund in refunds | itemsPerPage: pagesize" total-items="totalItems">
          <!-- <td><input type="checkbox" ng-checked="checkSelected(refund.Id)" ng-click="toggleRefund(refund)" ng-if="refund.Status == 0"></td> -->
          <td><input type="checkbox" ng-checked="checkSelected(refund.Id)" ng-click="toggleRefund(refund)"></td>
          <td>
            <a href>{{ refund.Enrollment.Student.FullName }}</a>
          </td>
          <td>{{ refund.Enrollment.Student.SID }}</td>
          <td>
            <span class="label label-info" ng-if="refund.EnrollmentTarget">Move</span>
            <span class="label label-warning" ng-if="!refund.EnrollmentTarget">Cancel</span>
            {{ refund.Type.Name }}
          </td>
          <td>{{ refund.Enrollment.CourseSchedule.CourseName }}</td>
          <td>{{ (refund.EnrollmentTarget) ? refund.EnrollmentTarget.CourseName : '-' }}</td>
          <td>{{ refund.RefundRequestDate }}</td>
          <td>
            {{ RefundStatus[refund.Status].Label }}
            &nbsp
            <!-- <a class="" href ng-really-message="Are you sure want to Re-Bank this refund?" ng-really-click="reBank(refund)" ng-if="refund.Status == 1">ReBank</a> -->
          </td>
        </tr>
      </tbody>
    </table>
    <dir-pagination-controls on-page-change="pageChanged(newPageNumber)" template-url="views/templates/dirPagination.tpl.html"></dir-pagination-controls>
  </div>
</div>
<div class="row">
  <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
    <button type="button" class="btn btn-primary" ng-click="proceedRefund()" ng-disabled="selectedRefunds.length < 1">Proceed Refund</button>
  </div>
  <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
    <button type="button" class="btn btn-primary" ng-click="cancelRefund()" ng-disabled="selectedRefunds.length < 1">Cancel Refund</button>
  </div>
  <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
    <button type="button" class="btn btn-primary" ng-really-message="Are you sure want to Re-Bank this refund?" ng-really-click="reBank()" ng-disabled="selectedRefunds.length < 1">Re-Bank</button>
  </div>
</div>